package core.proto.rightwindow;

import java.awt.Dimension;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JButton;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSplitPane;

public class Components extends JPanel implements MouseListener {
    JSplitPane splitPane1;
	JPanel chatPanel;
	BoardPane boardPanel;
	
	public Components() {
		super();
		chatPanel = new HttpChatPanel();
		boardPanel = BoardPane.getInstance();
		splitPane1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, 
				chatPanel, boardPanel);
		splitPane1.setOneTouchExpandable(true);
        splitPane1.setDividerLocation(300);

        //Provide minimum sizes for the two components in the split pane.
        Dimension minimumSize = new Dimension(150, 300);
        chatPanel.setMinimumSize(minimumSize);
        boardPanel.setMinimumSize(minimumSize);
        
        //Provide a preferred size for the split pane.
        splitPane1.setPreferredSize(new Dimension(1280, 700));
	}
	@Override
	public void mouseClicked(MouseEvent e) {

	}

	@Override
	public void mouseEntered(MouseEvent e) {

	}

	@Override
	public void mouseExited(MouseEvent e) {

	}

	@Override
	public void mousePressed(MouseEvent e) {

	}

	@Override
	public void mouseReleased(MouseEvent e) {
	}
	
    public JSplitPane getSplitPane() {
        return splitPane1;
    }
	
    /**
     * Create the GUI and show it.  For thread safety,
     * this method should be invoked from the
     * event-dispatching thread.
     */
    private static void createAndShowGUI() {

        //Create and set up the window.
        JFrame frame = new JFrame("InfoViz Right");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Components infoVizRight = new Components();
        frame.getContentPane().add(infoVizRight.getSplitPane());
		JButton b1 = new JButton("Rounded Lines");
		JButton b2 = new JButton("Rounded Rectangles");
		
		frame.getContentPane().add(b1);
		frame.getContentPane().add(b2);

        //Display the window.
        frame.pack();
        frame.setVisible(true);
    }

    public static void main(String[] args) {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
            }
        });
    }
}
